﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows;
using System.Collections.Specialized;

namespace Sinacor.Infra.UI.Controls.SmartClient
{
    public abstract class LogicalPanel : ConceptualPanel
    {
        protected sealed override void OnChildAdded(UIElement child)
        {
            if (LogicalTreeHelper.GetParent(child) == null)
                AddLogicalChild(child);
            OnLogicalChildrenChanged(child, null);
        }

        protected sealed override void OnChildRemoved(UIElement child)
        {
            if (LogicalTreeHelper.GetParent(child) == this)
                RemoveLogicalChild(child);
            OnLogicalChildrenChanged(null, child);
        }

        protected virtual void OnLogicalChildrenChanged(UIElement childAdded, UIElement childRemoved)
        {

        }
    }
}